package com.firmboy.project.component.test.service;

import java.util.HashMap;
import java.util.List;

import org.apache.ibatis.ognl.InappropriateExpressionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.firmboy.project.component.test.bean.AsDataDict;
import com.firmboy.project.component.test.dao.AsDataDictDao;

@Service

@SuppressWarnings({ "unchecked", "rawtypes" })
public class MyService {

	@Autowired
	private AsDataDictDao asDataDictDao;
	
	@Transactional(propagation=Propagation.REQUIRED)
	public List<AsDataDict> getTest() {

		String in = "7";

		AsDataDict asDataDict = new AsDataDict();
		asDataDict.setData(in);
		asDataDict.setDataDictId(in);
		asDataDict.setDataId(in);
		asDataDict.setLastdate(in);
		asDataDict.setOrdIndex(in);
		asDataDict.setRemark("wai");

		int insert = asDataDictDao.insert(asDataDict);

		testTra();
		

		List<AsDataDict> selectByParam = asDataDictDao.selectByParam(new HashMap());
		return selectByParam;
	}
	
	@Transactional(propagation=Propagation.NOT_SUPPORTED)
	public void testTra() {
		String in = "6";

		AsDataDict asDataDict = new AsDataDict();
		asDataDict.setData(in);
		asDataDict.setDataDictId(in);
		asDataDict.setDataId(in);
		asDataDict.setLastdate(in);
		asDataDict.setOrdIndex(in);
		asDataDict.setRemark("li");

		int insert = asDataDictDao.insert(asDataDict);
		
		//int c = 1 / 0;
	}
}
